<?
/*********************************************
*获取说明页所属分类
* *******************************************/
function smarty_function_qishi_explain_category($params, &$smarty)
{ 
extract($params);
global $db;
$listname = (NULL != $listname) ? $listname : 'list'; //默认的section名称
!empty($typeid)? $wheresqlarr['id']=intval($typeid):'1';//跟据栏目ID获取栏目信息
$titlelen = (NULL != $titlelen) ? $titlelen : 15; //默认显示标题数量
$dot = (NULL != $dot) ? $dot : ''; //默认截取后填补字符
$sql = "select * from ".table('explain_category')." where id=".$typeid;
$val=$db->getone($sql);
$List=$val;
$List['title']=cut_str($val['categoryname'],$titlelen,0,$dot);
$smarty->assign($listname, $List);
unset($List);
}
?>